package com.xuz.spring01.demo01;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * @user 65453
 * @date 2024/10/20 22:22
 */
public class SpringFactoryTest {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("bean.xml");
        User user = ctx.getBean("User", User.class);

        List<String> names = user.getFriends().getNames();
        for (String name : names) {
            System.out.println("FriendName: " + name);
        }

        ctx.close();
    }
}
